//
//  UserDefaultsManager.swift
//  iOSProjectExtensionSwift
//
//  Created by HBGG on 2020/7/17.
//  Copyright © 2020 lidianchao. All rights reserved.
//

import UIKit

class UserDefaultsManager: BaseManager {

    class func saveUserToken(token:String) {
        saveStringToUserDefaults(string: token, key: "user_token")
    }
    class func getUsereToken() ->String {
        let user_token = getStringValueFromUserDefaults(key: "user_token")
        return user_token
    }
    /***********************************/
    //存储string
    class func saveStringToUserDefaults(string:String, key:String) {
        let stand = UserDefaults.standard
        stand.set(string, forKey: key)
        stand.synchronize()
    }
    class func getStringValueFromUserDefaults(key:String) ->String {
        let stand = UserDefaults.standard
        let string = stand.object(forKey: key)
        if((string) != nil) {
            return string as! String
        }
        return ""
    }
}
